//
//  HCHotStoreViewController.m
//  HappyChildren
//
//  Created by WillyZhao on 2017/2/8.
//  Copyright © 2017年 WillyZhao. All rights reserved.
//

#import "HCHotStoreViewController.h"

#import "HCHotStoreView.h"

#import "HCFindHotStoreModel.h"

@interface HCHotStoreViewController () {
    HCFindHotStoreModel *model;
    HCHotStoreView *hsView;
}

@end

@implementation HCHotStoreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.textTitle = @"门店热榜";
    
    self.dataRequest.delegate = self;
    [self.dataRequest postHC_FindHotStore];
    
    [self initializeView];
    
    // Do any additional setup after loading the view.
}

-(void)initializeView {
    hsView = [[HCHotStoreView alloc] initWithFrame:CGRectMake(0, 0, self.centerView.frame.size.width, self.centerView.frame.size.height)];
    hsView.backgroundColor = YBKRGBCOLOR(241, 241, 241, 1);
    [self.centerView addSubview:hsView];
}

-(void)dataRequesterFinish:(DataRequester *)requester requesterWithType:(DataRequestType)aType receiveDictionary:(NSDictionary *)dictionary {
    NSLog(@"门店热榜信息:%@",dictionary);
    model = [[HCFindHotStoreModel alloc] initWithDictionary:dictionary error:nil];
    hsView.model = model;
}

-(void)dataRequesterFail:(DataRequester *)requester requesterWithType:(DataRequestType)aType receiveErrorDictionary:(NSDictionary *)dictionary {
    NSLog(@"门店热榜信息失败");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
